# Maintainer: Orhun Parmaksız <orhun@archlinux.org>

pkgname=rhit
pkgver=1.7.2
pkgrel=1
pkgdesc="A nginx log explorer"
arch=('loong64' 'x86_64')
url="https://github.com/Canop/rhit"
license=('MIT')
depends=('gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha512sums=('a9e473047c84f8142d2f099a13fab5e700c99a0175d82b1ce4b62b95b7d6d653d7e1fc85d4532eaf90b646ae2f913486e5a42b21646c5af36002e99d4a1084e4')

prepare() {
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}

# vim: ts=2 sw=2 et:
